package com.cloud.factory;

import com.cloud.enums.SupportImportMovieEnum;
import com.cloud.service.ImportMovieService;
import com.cloud.service.impl.imports.ImportMovieUPLOADServiceImpl;
import com.cloud.service.impl.imports.ImportMovieURLServiceImpl;

import java.util.HashMap;
import java.util.Map;

/**
 * @version v1.0
 * @author: TianXiang
 * @description: 获取导入视频的服务 (工厂 + 策略)
 * @date: 2020/11/24
 */
public class ImportMovieFactory {

    private static final Map<String, ImportMovieService> serviceMap = new HashMap<String, ImportMovieService>(){{
        put(SupportImportMovieEnum.URL.getCode(), new ImportMovieURLServiceImpl());
        put(SupportImportMovieEnum.UPLOAD.getCode(), new ImportMovieUPLOADServiceImpl());
    }};

    public static ImportMovieService getStrategyService(String strategyType) {
      return serviceMap.get(strategyType);
    }
}
